
<%@ page import="com.afb.HHPredJob" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'HHPredJob.label', default: 'HHPredJob')}" />
  <title><g:message code="default.create.label" args="[entityName]" /></title>
  <script type="text/javascript">
function toggle() {
  var ele = document.getElementById("toggleText");
  var text = document.getElementById("displayText");
  if(ele.style.display == "block") {
          ele.style.display = "none";
          text.innerHTML = "Show";
  }
  else {
          ele.style.display = "block";
          text.innerHTML = "Hide";
  }
}


function codename() {

if(document.formname.checkboxname.checked)
{
document.formname.textname.disabled=false;
}

else
{
document.formname.textname.disabled=true;
}
}



  </script>

</head>
<body>
  <div class="nav">
    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
  </div>
  <div  class="body">
    <h1><g:message code="default.create.label" args="[entityName]" /></h1>

    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${HHPredJobInstance}">
      <div class="errors">
        <g:renderErrors bean="${HHPredJobInstance}" as="list" />
      </div>
    </g:hasErrors>

    <g:form name="formname" action="save" method="post" enctype="multipart/form-data">

      <div class="dialog">

        <div class="tabberlive">
          <div id="barratitulo" class="barra" style="background-color:#F8F8F8;text-align:left;padding-left:20px">
            <label> Job Description </label>
          </div>
          <div class="tabbertab">
            <table>
              <tbody>
                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Name of the job" for="name"><g:message code="HHPredJob.name.label" default="Name" /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'name', 'errors')}">
              <g:textField title="Name of the job" name="name" value="${HHPredJobInstance?.name}" cols="300" rows="10" />
              </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label title="Description of the job" for="description"><g:message code="HHPredJob.description.label" default="Description" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'description', 'errors')}">
              <g:textArea title="Description of the job" name="description" value="${HHPredJobInstance?.description}" cols="300" rows="10"  />
              </td>
              </tr>
              </tbody>
            </table>

          </div>

          <br/>

          <div id="barratitulo" class="barra" style="background-color:#F8F8F8;text-align:left;padding-left:20px">
            <label> Input Options </label>
          </div>

          <div class="tabbertab">
            <table>
              <tbody>


                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Paste a list of protein sequences" for="proteinSequences"><g:message code="HHPredJob.proteinSequences.label" default="Protein Sequences" /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'proteinSequences', 'errors')}">
              <g:textArea title="Paste a list of protein sequences" id="styled" name="proteinSequences"  value="${HHPredJobInstance?.proteinSequences}" />
              </td>
              </tr>


              <tr class="prop">
                <td valign="top" class="name">
                  <label title="Upload a file with a list of protein sequences" for="proteinSequencesZIP"><g:message code="HHPredJob.proteinSequences.label" default="Protein Sequences" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'proteinSequences', 'errors')}">
                  <input title="Upload a file with a list of protein sequences" id="fileUpload" size="100%" type="file" name="proteinSequencesZIP"/>
                  <!--
                    <g:textArea id="styled" name="proteinSequences" cols="100" rows="10" value="${HHPredJobInstance?.proteinSequences}" />
                  -->
                </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="hmmDatabases" title="HMM database of concatenated HMMs, either generated with hhmake or with HMMER's hmmbuild."><g:message code="HHPredJob.hmmDatabases.label" default="Hmm Databases" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'hmmDatabases', 'errors')}">
              <g:select title="HMM database of concatenated HMMs, either generated with hhmake or with HMMER's hmmbuild." name="hmmDatabases" from="${HHPredJobInstance.constraints.hmmDatabases.inList}" value="${HHPredJobInstance?.hmmDatabases}" valueMessagePrefix="HHPredJob.hmmDatabases"  />
              </td>
              </tr>











             <tr class="prop">
                <td valign="top" class="name">
                  <label for="maxPairWiseSeqId" title="Maximum pairwise sequence identity (%) (def=90)"><g:message code="HHPredJob.maxPairWiseSeqId.label" default="Nº of cols per line" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'maxPairWiseSeqId', 'errors')}">
              <g:textField name="maxPairWiseSeqId" value="90" title="Maximum pairwise sequence identity (%) (def=90)"/>
              </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="diff" title="Filter most diverse set of sequences, keeping at least this many sequences in each block less than 50 columns (def=100)"><g:message code="HHPredJob.diff.label" default="# Diverse Sequences" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'Minimum probability', 'errors')}">
              <g:textField name="diff" value="100" title="Filter most diverse set of sequences, keeping at least this many sequences in each block of less than 50 columns (def=100)"/>
              </td>
              </tr>


              <tr class="prop">
                <td valign="top" class="name">
                  <label for="cov" title="Minimum coverage with query (%) (def=0)"><g:message code="HHPredJob.cov.label" default="Minimum Coverage" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'Minimum probability', 'errors')}">
              <g:textField name="cov" value="0" title="Minimum coverage with query (%)"/>
              </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="qid" title="Minimum sequence identity with query (%) (def=0)"><g:message code="HHPredJob.qid.label" default="Minimum Identity" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'Minimum Sequence Identity', 'errors')}">
              <g:textField name="qid" value="0" title="Minimum sequence identity with query (%) (def=0)"/>
              </td>
              </tr>


              <tr class="prop">
                <td valign="top" class="name">
                  <label for="qsc" title="Minimum score per column with query  (def=20.0)"><g:message code="HHPredJob.qsc.label" default="Minimum score" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'Minimum Score per column with query', 'errors')}">
              <g:textField name="qsc" value="20" title="Minimum score per column with query  [0,100]  (def=20.0)"/>
              </td>
              </tr>


              </tbody>

            </table>

          </div>

          <br/>

              




            <div id="barratitulo" class="barra" style="background-color:#F8F8F8;text-align:left;padding-left:20px">
            <label> Output Options </label>
          </div>




          <div>
          <table>
          <tbody>


              <tr class="prop">
                <td valign="top" class="name">
                  <label for="aliw" title="Number of columns per line in alignment list (def=80)"><g:message code="HHPredJob.aliw.label" default="Nº of cols per line" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'widthOfAlignments', 'errors')}">
              <g:textField name="aliw" value="80" title="Number of columns per line in alignment list (def=80)"/>
              </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="p" title="Minimum probability in summary and alignment list (def=20)"><g:message code="HHPredJob.p.label" default="Minimum probability" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'Minimum probability', 'errors')}">
              <g:textField name="p" value="20" title="Minimum probability in summary and alignment list (def=20)"/>
              </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="e" title="Maximum E-value in summary and alignment list (def=1E+006)"><g:message code="HHPredJob.e.label" default="Maximum E-value" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'e', 'errors')}">
              <g:textField name="e" value="0.000001" title="Maximum E-value in summary and alignment list (def=1E+006)"/>
              </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="zmax" title="Max Nº of lines in summary hit list"><g:message code="HHPredJob.zmax.label" default="Max Nº of lines" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'zmax ', 'errors')}">
              <g:textField name="zmax" value="500" title="Maximum Nº of lines in summary hit list"/>
              </td>
              </tr>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="zmin" title="Minimum number of lines in summary hit list (def=10)"><g:message code="HHPredJob.zmin.label" default="Min Nº of lines" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'zmin ', 'errors')}">
              <g:textField name="zmin" value="10" title="Minimum number of lines in summary hit list (def=10)"/>
              </td>
              </tr>


              <tr class="prop">
                <td valign="top" class="name">
                  <label for="bmax" title="Maximum number of alignments in alignment list (def=500)"><g:message code="HHPredJob.bmax.label" default="Max Nº of alignments" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'bmax ', 'errors')}">
              <g:textField name="bmax" value="500" title="Maximum number of alignments in alignment list (def=500)"/>
              </td>
              </tr>


              <tr class="prop">
                <td valign="top" class="name">
                  <label for="bmin" title="Minimum number of alignments in alignment list (def=10)"><g:message code="HHPredJob.bmin.label" default="Min Nº of alignments" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'bmin ', 'errors')}">
              <g:textField name="bmin" value="10" title="Minimum number of alignments in alignment list (def=10)"/>
              </td>
              </tr>


              </tbody>

            </table>

          </div>

          <br/>

            
            <div id="barra" class="barra" style="background-color:#ff9900;text-align:left;padding-left:20px">
              <label> More options </label><a id="displayText" href="javascript:toggle();"> Show</a>
            </div>
<br/>

          <div class="tabbertab" id="toggleText" style="display: none">
            <div id="barratitulo" class="barra" style="background-color:#F8F8F8;text-align:left;padding-left:20px">
              <label> HMM-HMM alignment </label>
            </div>

            <div>


              <table>

                <tbody>











                  <tr class="prop">
                    <td valign="top" class="name">
                      <label title="Realign displayed hits with max. accuracy (MAC) algorithm" for="realign"><g:message code="HHPredJob.realign.label" default="Realign" /></label>
                    </td>
                    <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'realign', 'errors')}">
                <g:checkBox title="Realign displayed hits with max. accuracy (MAC) algorithm" name="realign" value="${HHPredJobInstance.realign}"/>
                </td>
                </tr>

                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Posterior probability threshold for MAC re-alignment (def=0.300) Parameter controls alignment greediness: 0:global >0.1:local" for="mact"><g:message code="HHPredJob.mact.label" default="Probability for re-align." /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'mact', 'errors')}">
                <g:select  name="mact" from="${HHPredJobInstance.constraints.mact.inList}" value="0.3" valueMessagePrefix="HHPredJob.mact"  />
                </td>
                </tr>


                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Use global/local alignment mode for searching/ranking (def=local)" for="globloc"><g:message code="HHPredJob.globloc.label" default="Alignment Mode" /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'globloc', 'errors')}">
                <g:select  name="globloc" from="${HHPredJobInstance.constraints.globloc.inList}" value="Local" valueMessagePrefix="HHPredJob.globloc"  />
                </td>
                </tr>


                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Show up to this many significant alternative alignments(def=2)" for="alt"><g:message code="HHPredJob.alt.label" default="Nº alternate Align." /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'alt', 'errors')}">
                <g:textField name="alt" value="2" title="Show up to this many significant alternative alignments(def=2)"/>
                </td>
                </tr>




                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Score offset  (range [-1,1]  ,  def=-0.01)" for="alt"><g:message code="HHPredJob.shift.label" default="Score offset" /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'shift', 'errors')}">
                <g:textField name="shift" value="-0.01" title="Score offset  (range [-1,1]  ,  def=-0.01)"/>
                </td>
                </tr>


                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Weight of term for pair correlations ( range [0,1]  , def=0.10)" for="alt"><g:message code="HHPredJob.corr.label" default="Weight of Term" /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'corr', 'errors')}">
                <g:textField name="corr" value="0.1" title="Weight of term for pair correlations (def=0.10 , range [0,1] )"/>
                </td>
                </tr>




                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="0: no ss scoring, 1,2: ss scoring after or during alignment  [default=2] ,  3,4: ss scoring after or during alignment, predicted vs. predicted    " for="ssm"><g:message code="HHPredJob.ssm.label" default="Alignment Mode" /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'ssm', 'errors')}">
                <g:select  name="ssm" from="${HHPredJobInstance.constraints.ssm.inList}" value="2" valueMessagePrefix="HHPredJob.ssm"  />
                </td>
                </tr>

                <tr class="prop">
                  <td valign="top" class="name">
                    <label title="Weight of ss score  (range [-1,1]  ,  def=0.11)" for="alt"><g:message code="HHPredJob.ssw.label" default="Weight of ss score" /></label>
                  </td>
                  <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'ssw', 'errors')}">
                <g:textField name="ssw" value="0.11" title="Weight of ss score  (range [-1,1]  ,  def=0.11)"/>
                </td>
                </tr>






                </tbody>

              </table>

            </div>

            <br/>





            <div id="barratitulo" class="barra" style="background-color:#F8F8F8;text-align:left;padding-left:20px">
              <label> More Options </label>
            </div>
            <table>
              <tbody>





              <g:ifUserHasRole roles="Administrator">
                <tr class="prop">
              </g:ifUserHasRole>
              <g:ifUserHasRole roles="Registered">
                <tr id="notvisible" class="prop">
              </g:ifUserHasRole>
              <td valign="top" class="name">
                <label for="user"><g:message code="HHPredJob.user.label" default="User" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: HHPredJobInstance, field: 'user', 'errors')}">
                <!--
                  <g:select name="user.id" from="${com.afb.User.list()}" optionKey="id" value="${HHPredJobInstance?.user?.id}"  />
                -->
              <g:select name="user.id" from="${com.afb.User.list()}" optionKey="id" value="${session?.user.id}"  />
              </td>
              </tr>



              </tbody>
            </table>

          </div>
        </div>


      </div>
      <div class="buttons">
        <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'CreateNew')}" /></span>
      </div>
    </g:form>
  </div>
</body>
</html>
